<?php
session_start();
if ( isset($_SESSION['datos_admin']['estado']) )
{
 // ya se ha pasado por el login
echo "ya has iniciado una sesi�n...";
echo "<script type=\"text/javascript\">
 history.go(-1);
 </script>";
} 
else // no se ha pasado por login
{ 

include("header.php");
include(XOOPS_ROOT_PATH."/header.php");
$mydirname = basename( dirname( __FILE__ ) ) ;
	
/* $myts =& MyTextSanitizer::getInstance();
$module_id = $xoopsModule->getVar('mid');

if (is_object($xoopsUser)) {
    $groups = $xoopsUser->getGroups();
} else {
	$groups = XOOPS_GROUP_ANONYMOUS;
}

$gperm_handler =& xoops_gethandler('groupperm');

if (isset($_POST['item_id'])) {
    $perm_itemid = intval($_POST['item_id']);
} else {
    $perm_itemid = 0;
}
//If no access
if (!$gperm_handler->checkRight("resume_submit", $perm_itemid, $groups, $module_id)) {
    redirect_header(XOOPS_URL."/user.php", 3, _NOPERM);
    exit();
} */

    global $xoopsDB, $xoopsConfig, $xoopsUser, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsModuleConfig, $mydirname;

	$token = $GLOBALS['xoopsSecurity']->createToken();
	include_once (XOOPS_ROOT_PATH."/modules/$mydirname/include/functions.php");
	
	include_once (XOOPS_ROOT_PATH."/class/xoopstree.php");
	
// Detecci�n de errores
     echo "<script type=\"text/javascript\">
           function verify() {
                var msg = \""._VALIDREGISTRO."\\n__________________________________________________\\n\\n\";
                var errors = \"FALSE\";

                if (document.add.login.value == \"\") {
                        errors = \"TRUE\";
                        msg += \""._VALIDUSUARIO."\\n\";
                } 
				if (document.add.clave.value == \"\") {
                        errors = \"TRUE\";
                        msg += \""._VALIDCONTRASENA."\\n\";
                }
				
                if (errors == \"TRUE\") {
                        msg += \"__________________________________________________\\n\\n"._VALIDREGISTRO2."\\n\";
                        alert(msg);
                        return false;
                }
          }
          </script>";
		  
    echo '<link type="text/css" rel="stylesheet" href="dhtmlgoodies_calendar/dhtmlgoodies_calendar.css?random=20051112" media="screen"></LINK>
	<SCRIPT type="text/javascript" src="dhtmlgoodies_calendar/dhtmlgoodies_calendar.js?random=20060118"></script>';
			  
	  echo "<script type=\"text/javascript\">
	 function numeros(e) {
    tecla = (document.all) ? e.keyCode : e.which; 
    if (tecla==8) return true; 
    patron =/\d/; 
    te = String.fromCharCode(tecla); 
    return patron.test(te);
    } 
      </script>"; 

			echo "<table width='50%' border='0' cellspacing='1' cellpadding='8'><tr class='bg4'><td valign='top'>\n";
		    echo "<b><center>"._REGISTRO."</b><br /><br /><img src=\"images/egresados.gif\" border=0 alt=\""._INFO_EGRESADOS."\" /><br><br>"._INFO_REGISTRO."</center><br /><br />";
		
			echo "<form method=\"post\" action=\"validacion2.php\" enctype=\"multipart/form-data\" name=\"add\" onsubmit=\"return verify();\">";
					  
			echo "<table width='50%' class='outer' cellspacing='1'>
			<tr>
			<td width='35%' class='even'><b>"._USUARIO."</b> </td><td class='even'><input type=\"text\" name=\"login\" size=\"20\" maxlength=\"15\" onKeypress=\"return numeros(event);\"/></td>
			</tr><tr>
			<td width='35%' class='odd'><b>"._CONTRASENA." </b></td><td class='odd'>
		    <input type=\"text\" name=\"clave\" id=\"clave\" maxlength=\"10\"><input type=\"button\" value=\"Cal\" onclick=\"displayCalendar(document.getElementById('clave'),'yyyy-mm-dd',this)\">

			</td></tr>";
					
	            $time = time();

	        echo "</table><br />";
			echo "<input type=\"hidden\" name=\"token\" value=\"$token\" />
			<input type=\"hidden\" name=\"date\" value=\"$time\" />
			<center><input type=\"submit\" value=\""._INGRESAR."\" onClick=\"self.location.href='validacion2.php'\" />
			<input name=\"btncancelar\" type=\"button\" id=\"btncancelar\" onClick=\"self.location.href='bienvenida.php'\"  value=\""._JOBS_RES_BACKTO."\">";
				
			echo "<br><br>"._INFO_REGISTRO2."</center>";
			echo "</form>";
			echo "</td></tr></table>";
			
			echo "<br /><br />
<div align=\"center\">" . _INFO_PAG . "</div>
<br /><br />";
	   	
include(XOOPS_ROOT_PATH."/footer.php");
}
?>
